
#pragma hdrstop

#include "DebugKonsole.h"

#pragma package(smart_init)
#pragma resource "*.dfm"

__fastcall DebugKonsole::DebugKonsole(TComponent* owner,String title):TForm(owner){
	this->Caption = "DebugKonsole: " + title;
	this->Width = 300;
	this->Height = 500;
	this->Enabled = true;
	this->WindowState = wsNormal;

	edit = new TRichEdit(this);
	edit->SetParentComponent(this);
	edit->SetBounds(0,0,300,500);

	this->Visible = true;

/* BlackBox Test
	int x, y;
	string typ;

	typ= "And";
	int werte[11][2] = { {0,31}, {10,41}, {5,35}, {-1,30}, {11,41}, {60,31},
						{70,41}, {65,35}, {59,30}, {71,42}, {-1,-1} };

	int i = 0;
	for( i =0 ; i<11 ;i++){
		stringstream log;
		x = werte[i][0];y= werte[i][1];
		log << "x=" << x << " y= " << y << " typ= " << typ << " Ergebnis: " << PinDef::getPinFromCoord(x,y,typ.c_str());

		this->addLog( log.str().c_str() );
	}
*/
}


void __fastcall DebugKonsole::addLog(String s){

	this->edit->Text = s + "---\n" + this->edit->Text;

}


void __fastcall DebugKonsole::clearLog(){
	this->edit->Text = "";
}


__fastcall DebugKonsole::~DebugKonsole(){
     delete(edit);
}

